<?php
/**
* Page comment manager.
*
* Copyright (c) 2009 James Gauld <james@jamesgauld.net>
* This file is part of Scribble.
* @license http://www.scribblecms.co.uk/license.txt
*
* @package Scribble
*/
class PageCommentManager extends ScribbleModelManager {

	/**
	* Set "datecreated" column and ensure the www link is prefixed with "http://".
	*
	* @param Buan\Model Model to save
	* @return bool
	*/
	public function save($model) {
		if(!$model->isInDatabase()) {
			$model->datecreated = time();
		}
		if($model->authorwww!='') {
			$model->authorwww = preg_replace("/^(http:\/\/)*/i", "http://", $model->authorwww);
		}
		return parent::save($model);
	}
}
?>